package mua.core.operation.list;

import mua.core.value.List;
import mua.core.value.MuaValue;
import mua.core.value.Word;

import java.util.ArrayList;

public class First {
    public static MuaValue run(MuaValue a) {
        if(a instanceof List){
            ArrayList<MuaValue> list = (ArrayList<MuaValue>)a.getValue();
            return list.get(0);
        }
        String str = a.toString();
        return new Word(""+str.charAt(0));
    }
}
